package com.apexsoft.front.common.utils;

import java.io.IOException;
import java.util.Properties;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

/**
 * Spring properties文件配置读取器
 * @author zhengjin
 *
 */
public class SpringPropertyResourceReader extends PropertyPlaceholderConfigurer{
	
	public SpringPropertyResourceReader() throws IOException {
		super();
		//加载System级别参数
		setSearchSystemEnvironment(true);
		//赋值静态对象参数至Bean
		setProperties(properties);
	}
	//静态配置对象
	private static Properties properties = new Properties();
	
	public static String getProperty(String propertyName) {
		return properties.getProperty(propertyName);
	}
	public static Integer getPropertyToInt(String propertyName) {
		return Integer.valueOf(properties.getProperty(propertyName));
	}
	public static void setProperty(String propertyName,String value){
		properties.setProperty(propertyName, value);
	}
}
